package com.bwie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.common.domain.User;
import com.bwie.mappper.UserMapper;
import com.bwie.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @Author：ShenJiaFeng
 * @Package：com.bwie.service.impl
 * @Project：zg6_week11
 * @name：UserServiceImpl
 * @Date：2024/4/25 9:23
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
        implements UserService {

    /**
     * 根据姓名查询用户信息
     * @param userName
     * @return
     */
    @Override
    public User findByUserName(String userName) {
        return getOne(
                new LambdaQueryWrapper<User>(){{
            eq(User::getUserName,userName);
        }});
    }
}
